﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataTransferBetweenViews.Model;

namespace DataTransferBetweenViews.ViewModel
{
    public class BaseViewModel
    {
        private static IModel model;
        private SenderViewModel senderViewModel;
        private ReceiverViewModel receiverViewModel;

        public BaseViewModel()
        {
            model = new Model.Model();
        }

        public SenderViewModel SenderViewModel
        {
            get
            {
                if (this.senderViewModel == null)
                {
                    this.senderViewModel = new SenderViewModel(model);
                }

                return this.senderViewModel;
            }
        }

        public ReceiverViewModel ReceiverViewModel
        {
            get
            {
                if (this.receiverViewModel == null)
                {
                    this.receiverViewModel = new ReceiverViewModel(model);
                }

                return this.receiverViewModel;
            }
        }
    }
}
